
<!--
<a  href="#" onclick="return comfirmdelete_popup({id:'50',type:'comments'})" >comfirm delete</a>
-->
<div id="comfirmdelete"></div>
<!--
<div id="bgPopup" style="opacity: 0.7; display: block;"></div>
-->
<div id="formdangky"></div><!--End #formdangky-->


<!--
    <a class="popup" href="http://localhost/hoidap/Source/likes/index/getuserlikesbypost?post=1234">like</a> 
-->
	<?php 
		//$iduser = $this->iduser;
		$iduser = 1;
	?>
	<input type="hidden" id="input_iduser" name="iduser" value="<?php echo $iduser;?>"/>
	<div id="" class="wrapper">
		<div id="leftContent" class="floatLeft">

			<!-- <div id="" class="box">
				<h1 id="sht" class="ansq">Yeu thich<a href="#" title="" class="floatRight">Ẩn/Hiện</a></h1>

				<ul id="listOfQ" class="userLi">
					<li><img src="images/Imess.png" alt=""><a href="" title="">Tin nhan</a></li>
					<li><a href="" title="">Bang tin </a><span>34</span></li>
					<li><a href="" title="">Cau hoi</a></li>
					<li><a href="" title="">Ban be</a></li>
					<li><a href="" title="">Hoi nhom </a></li>
				</ul><!-- / LIST QUESTION
			</div><!-- / BOX -->
			
			<div class="box_user">
				<div class="userImageSmall"><img src="image/1.jpg"></div>
				<div class="mg_top_50">
					<ul>
						<li> <span class="text1">YÊU THÍCH</span>
							<ul class="mg-l10">
								<li class="text2"> <a href="#">Bảng tin</a></li>
								<li class="text2"> <a href="#">Tin nhắn</a></li>
								<li class="text2"> <a href="#">Câu hỏi của bạn</a></li>
								<li class="text2"> <a href="#">Tìm kiếm bạn bè</a></li>
							</ul>
						</li>
						<div class="bd_b1">&nbsp;</div>
						<li> <span class="text1">DANH SÁCH</span>
							<ul class="mg-l10">
								<li class="text2"> <a href="#">Gia đình</a></li>
								<li class="text2"> <a href="#">Bạn bè</a></li>
								<li class="text2"> <a href="#">Người thân</a></li>
								<li class="text2"> <a href="#">Người quen</a></li>
								<li class="text2"> <a href="#">Đang theo dõi</a></li>
								<li class="text2"> <a href="#">Được theo dõi</a></li>
							</ul>
						</li>
						<div class="bd_b1">&nbsp;</div>
						<li> <span class="text1">NHÓM</span>
							<ul class="mg-l10">
								<li class="text2"> <a href="#">Tạo nhóm</a></li>
							</ul>
						</li>
						

					</ul>
				</div>
			</div>
			
		</div><!-- / LEFT CONTENT-->
		<div id="container">
		<div id="centerContent" class="floatLeft">
		<!--
			<?php
			$Listscate = $this->Listscate;
			foreach ($Listscate AS $cate)
			{						
				echo "<option value='$cate[ID]'>$cate[category_name]</option>";
			}
			?>
			-->
			<div id="" class="box">
				<ul id="" class="Seditor">
					<li class="vietcauhoi"><img src="<?php echo $this->baseUrl('public/images/writeq.jpg')?>" alt=""><a href="javascript:;" title="">Viết câu hỏi</a></li>
					<li class="themhinhanh"><img src="<?php echo $this->baseUrl('public/images/writei.jpg')?>" alt=""><a href="javascript:;" title="">Tạo album hình</a></li>
					<li class="capnhattrangthai"><img src="<?php echo $this->baseUrl('public/images/writes.jpg')?>" alt=""><a href="javascript:;" title="">Cập nhật trạng thái</a></li>
					<div id="" class="clear"></div>
				</ul>
				<div id="" class="post">
					<div class="dieuhuong"></div>
					
					<div class="top_post post_cauhoi">
						<form method="post" enctype="multipart/form-data">
						<input type="hidden" id="img_post_ch" value=""/>
						<!--
						<div class="testabc">
						
						<a href="abcde333">
						abcd
						</a>
						</div>
						
						<!--
						<div id="testab"><img src="http://media.vatgia.vn/thumb140/11/small_vwx1271149130.jpg" id="mmnnbb" class="afterImage img_status_posted_edit" style="padding: 0px; display: block;">
									</div>
						-->
						<!--
						<textarea class="input_nd_ch val_textarea_status" type="text" name="nd_cauhoi"></textarea>
						-->
						<div class="tit_post_ch">
						<input class="title_post_ch" type="text" name = "title_post_ch" placeholder="Tiêu đề câu hỏi..."/>
						</div>
						<textarea name="nd_cauhoi" class="input_nd_ch val_textarea_status" type="text" placeholder="Nội dung câu hỏi..." 
						rows=1 style="height:auto" id="post_new_status" 
						onfocus="show_text_area_status({idn:this.id,classShow:'postsbottom'})" 
						onkeyup="auto_grow_area3(this.id)"></textarea>

						<div class="postsbottom" style="display:none">
									<div class="after_att panel_posted_status_edit_img" style="display:none;">
									<div class="img_link_post"><img class="afterImage img_status_posted_edit" id="use_image_status" src="<?php echo $this->baseUrl('public/images/loading.gif')?>" />
									</div>
									<div class="noidung_link_post" id="">
									<div class="mg_top_5"><span href=# class="title_post_link title_post_status_edit" onclick="click_edit_({text:this.innerHTML,cln:'title_post_status_edit',inp:'input',w:document.getElementById('id_width').offsetWidth});"></span></div>
									<div><a id="meta_link" class="link_post_link link_posted_status"></a></div>
									<span id="meta_content" class="content_post_link noidung_post_status_edit" onclick="click_edit_({text:this.innerHTML,cln:'noidung_post_status_edit',w:document.getElementById('id_width').offsetWidth ,h:document.getElementById('id_width').offsetHeight});"></span>

									<div class="select_image_link_status none_display">
									<p class="btn_next_prev">
									<img class="nextPrev prev_img_status" src="<?php echo $this->baseUrl('public/images/prev_status.png')?>">
									<img class="nextPrev next_img_status" src="<?php echo $this->baseUrl('public/images/next_status.png')?>">
									<span class="text_1">Chọn một hình</span>
									</p>
									</div><br><br>
									<div class="khongdunghinh">
									<input type="checkbox" name="s" class="lfloat" id="checkStatusImage" onchange="(document.getElementById('use_image_status').style.display=='none') ? 
									document.getElementById('use_image_status').style.display='block' : document.getElementById('use_image_status').style.display='none';">
									<label class="lfloat mg_left_10 c44 bold" for="checkStatusImage">Không dùng hình.</label>
									</div>
									</div>
									</div>	
							<div class="boundLinkStatus">
							<input type="text" class="input " placeholder="http://" onkeyup="return waiting_getlink_status(this.value);">
							</div>
						</div>
						<div class="ct_post_ha_ch">
							<p>Chọn một tập tin hình ảnh từ máy của bạn</p>
							<input type="file" name="images" id="images_ch" multiple />
							<p class="loading_img_ch"><img src="<?php echo $this->baseUrl('public/images/loading.gif')?>"/></p>
							<ul class="image_list_ch"></ul>
							<script src="<?php echo $this->baseUrl('public/js/upload_ha_ch.js')?>" type="text/javascript"></script>
						</div>
						<div class="control_post">
							<ul>
								<li class="hinhanh_post"></li>
								<li class="link_post"></li>
								<li class="">
									<select  id="categories_cha" name="categories_cha" onchange="return catelogy_select_text({id:'select_cat_parent' , parent:this.value})" >
										<option value="0">Chọn loại câu hỏi</option>
										<?php
										$Listscate = $this->Listscate;
										foreach ($Listscate AS $cate)
										{						
											echo "<option value='$cate[ID]'>$cate[category_name]</option>";
										}
										?>
										<option value="-1">Xem tất cả</option>
									</select>
						
									<span id="select_cat_parent">
										<select   id="categories_con" name="categories_con">
										<option value="0">Chọn Danh mục câu hỏi</option>
										</select>
									</span>
								</li>
								<!--
								<li class="">
									<select id="active" name="categories_cha">
										<option value="">option 1</option>
										<option value="">option 1</option>
										<option value="">option 1</option>
										<option value="">option 1</option>
										<option value="">option 1</option>
									</select>
								</li>
								-->
								<li class="btn_post_nd" onclick="return waiting_load_status_and_question({noidung:'input_nd_ch', 
								catcha:'categories_cha', catcon:'categories_con', tieude:'title_post_ch'})"  >Đăng câu hỏi</li>
							</ul>
						</div>
						</form>
					</div><!--End .post_cauhoi-->
					<div class="top_post post_hinhanh">
						<form method="post" enctype="multipart/form-data"  action="upload.php">
						<input type="hidden" id="img_post_ha" value=""/>
						<textarea class="input_nd_ha" type="text" name="nd_hinhanh"></textarea>
						<div class="ct_post_ha">
							<p>Chọn một tập tin hình ảnh từ máy của bạn</p>
							<input type="file" name="images" id="images" multiple />
							<p class="loading_img"><img src="<?php echo $this->baseUrl('public/images/loading.gif')?>"/></p>
							<ul class="image_list"></ul>
							<script src="<?php echo $this->baseUrl('public/js/upload.js')?>" type="text/javascript"></script>
						</div>
						<div class="control_post">
							<ul>
								<li class="btn_post_nd" onclick="return submit_images_album({noidung:'input_nd_ha', 
								hiddeninput:'categories_cha'})"  >Đăng hình ảnh</li>
							</ul>
						</div>
						</form>
					</div><!--End .post_hinhanh-->
					
					
					
					<div class="top_post post_trangthai">
					<form>
						<textarea class="input_nd_th" type="text" name="nd_trangthai"></textarea>
						
						<div class="postsbottom" style="display:none">
									<div class="after_att panel_posted_status_edit_img_tt" style="display:none;">
									<div class="img_link_post"><img class="afterImage img_status_posted_edit_tt" id="use_image_status_tt" src="<?php echo $this->baseUrl('public/images/loading.gif')?>" />
									</div>
									<div class="noidung_link_post" id="">
									<div class="mg_top_5"><span href=# class="title_post_link title_post_status_edit_tt" onclick="click_edit_({text:this.innerHTML,cln:'title_post_status_edit_tt',inp:'input',w:document.getElementById('id_width').offsetWidth});"></span></div>
									<div><a id="meta_link" class="link_post_link link_posted_status_tt"></a></div>
									<span id="meta_content" class="content_post_link noidung_post_status_edit_tt" onclick="click_edit_({text:this.innerHTML,cln:'noidung_post_status_edit_tt',w:document.getElementById('id_width').offsetWidth ,h:document.getElementById('id_width').offsetHeight});"></span>

									<div class="select_image_link_status_tt none_display">
									<p class="btn_next_prev">
									<img class="nextPrev prev_img_status_tt" src="<?php echo $this->baseUrl('public/images/prev_status.png')?>">
									<img class="nextPrev next_img_status_tt" src="<?php echo $this->baseUrl('public/images/next_status.png')?>">
									<span class="text_1">Chọn một hình</span>
									</p>
									</div><br><br>
									<div class="khongdunghinh">
									<input type="checkbox" name="s" class="lfloat" id="checkStatusImage" onchange="(document.getElementById('use_image_status_tt').style.display=='none') ? 
									document.getElementById('use_image_status_tt').style.display='block' : document.getElementById('use_image_status_tt').style.display='none';">
									<label class="lfloat mg_left_10 c44 bold" for="checkStatusImage">Không dùng hình.</label>
									</div>
									</div>
									</div>	
							<div class="boundLinkStatus">
							<input type="text" class="input " placeholder="http://" onkeyup="return waiting_getlink_status_trangthai(this.value);">
							</div>
						</div>
						
						
						
						
						<!--
						<div class="input_link_post">
							<input type="text" name="input_link_post" placeholder="http://"/>
						</div>
						-->
						<div class="control_post">
							<ul>
								<li class="hinhanh_post"></li>
								<li class="link_post"></li>
								<li class="btn_post_nd" onclick = "return submit_post_trangthai();">Đăng trạng thái</li>
							</ul>
						</div>
					</form>	
					</div><!--End .post_trangthai-->
					<script type="text/javascript">
					$('.post_hinhanh').hide();
					$('.post_trangthai').hide();
					$('.input_link_post').hide();
					$('.boundLinkStatus').hide();
					
					$(document).ready(function(){
						$('.vietcauhoi').click(function(){
							$('.post_cauhoi').show();
							$('.post_hinhanh').hide();
							$('.post_trangthai').hide();
							$('.dieuhuong').css("margin-left","40px");
						});
						$('.themhinhanh').click(function(){
							$('.post_cauhoi').hide();
							$('.post_hinhanh').show();
							$('.post_trangthai').hide();
							$('.dieuhuong').css("margin-left","200px");
						});
						$('.capnhattrangthai').click(function(){
							$('.post_cauhoi').hide();
							$('.post_hinhanh').hide();
							$('.post_trangthai').show();
							$('.dieuhuong').css("margin-left","380px");
						});
						
						$('.link_post').click(function(){
							$('.input_link_post').slideToggle();
							$('.boundLinkStatus').slideToggle('fast');
						});
					});
					</script>
				</div><!-- / -->	
			</div><!-- / BOX-->


			<div id="" class="box">
				
				
					<div id="new_post" ></div>

				<?php
				
				
				$detais = $this->post['row'];
				$thaoluan = $this->post['rowparent'];
				$userlike = $this->post['userlike'];
			
			/*
				echo "<pre>";				
				print_r($thaoluan);
				echo "</pre>";
			*/
				foreach ($detais AS $k => $detai)
				{
				$songuoilike = count($userlike[$k]);
				
				?>
						
						
				<div id="listPost_<?php echo $detai['ID']; ?>" class="listPost">
				<span class="listpost_span">
					<div class="edit_post">
						<ul>
							<li class="firstItem"></li>
							<li class="lastItem" onclick="return comfirmdelete_popup({id:'<?php echo $detai['ID']; ?>',type:'post'})"></li>
						</ul>
					</div>
					<img src="<?php echo $this->baseUrl('public/images/ava.jpg')?>" alt="">
					<h1><a href="" title="">le huy truyen</a> - <?php echo $detai['p_datetime']; ?></h1>
					<div class="post_show_title"><?php echo $detai['post_title']; ?></div>
				
					<div class="post_show_content"><?php echo $detai['post_content']; ?></div>
				
					<?php 
					
					if($detai['post_type']==1)
					{
						//Hiển thị link
						
						if($detai['meta_images'] != "")
						{
							$meta_hinhanh =$detai['meta_images'];
						}
						else
						{
							//TODO: thay link hinh khi ko co hinh
							$meta_hinhanh ="";
						}
						$metablock = "block";
						if($detai['meta_title'] == NUll)
						{
							$metablock = "none";
						}
						?>
						<div class="post_link_comment" style="display:<?php echo $metablock ?>">
									
									<div class="img_link_post_cm">
										<img src="<?php echo $meta_hinhanh?>" />
									</div>
									<div class="noidung_link_post_cm" id="">
										<div class="tittle_link_post_cm">
												<a href="<?php echo $detai['meta_link']; ?>" target="_blank">
													<?php echo $detai['meta_title']; ?>								
												</a>
										</div>
										<div class="cling_link_post_cm">
											<a href="<?php echo $detai['meta_link']; ?>" target="_blank">
												<?php echo $detai['meta_base_url']; ?>			
											</a>
										</div>
										<div class="meta_link_post_cm">
											<?php echo $detai['meta_description']; ?>	
										</div>
									</div>
									<div class="clear"></div>
									
						</div>		
					<?php
						$post_images = $detai['post_image'];
						if($post_images !="")
						{
							$arr_images = explode(",", $post_images);
							$sl = count($arr_images);
							echo "<div class='post_show_image'>";
							if($sl >= 4){
								foreach($arr_images as $i => $img){
									$url_img = $this->baseUrl('public/images/uploads/'.$img);
									echo "<a class='post_ha_".($i+1)." lb lb_abc' title='abcd' href='$url_img'><img src='$url_img' /></a>";
									if($i==3) break;
								}
							}
							elseif($sl > 1){
								foreach($arr_images as $i => $img){
									$url_img = $this->baseUrl('public/images/uploads/'.$img);
									echo "<a class='post_ha_".($i+2)." lb lb_abc' title='abcd' href='$url_img'><img src='$url_img' /></a>";
								}
							}elseif($sl == 1){
								foreach($arr_images as $i => $img){
									$url_img = $this->baseUrl('public/images/uploads/'.$img);
									echo "<a class='post_ha_".$i." lb lb_abc' title='abcd' href='$url_img'><img src='$url_img' /></a>";
								}
							}
							echo "</div>";
						}
					
					}

					if($detai['post_type']==2)
					{
						$post_images = $detai['post_image'];
						$arr_images = explode(",", $post_images);
						$sl = count($arr_images);
						echo "<div class='post_show_image'>";
						if($sl >= 4){
							foreach($arr_images as $i => $img){
								$url_img = $this->baseUrl('public/images/uploads/'.$img);
								echo "<a class='post_ha_".($i+1)." lb lb_abc' title='abcd' href='$url_img'><img src='$url_img' /></a>";
								if($i==3) break;
							}
						}
						elseif($sl > 1){
							foreach($arr_images as $i => $img){
								$url_img = $this->baseUrl('public/images/uploads/'.$img);
								echo "<a class='post_ha_".($i+2)." lb lb_abc' title='abcd' href='$url_img'><img src='$url_img' /></a>";
							}
						}elseif($sl == 1){
							foreach($arr_images as $i => $img){
								$url_img = $this->baseUrl('public/images/uploads/'.$img);
								echo "<a class='post_ha_".$i." lb lb_abc' title='abcd' href='$url_img'><img src='$url_img' /></a>";
							}
						}
						echo "</div>";
					
					
					
					
					
					/*
						$post_images = $detai['post_image'];
						$arr_images = explode(",", $post_images);
						$sl = count($arr_images);
						echo "<div class='post_show_image'>";
						if($sl >=4){
							for($i=0; $i<4; $i++){
								echo "<a class='post_ha_".($i+1)." lb lb_abc' title='abcd' href='/hoidap/source/public/images/uploads/h".($i+1).".jpg'><img src='/hoidap/source/public/images/uploads/h".($i+1).".jpg' /></a>";
							}
						}elseif($sl>1){
							for($i=0; $i<$sl; $i++){
								echo "<a class='post_ha_".($i+2)." lb lb_abc' title='abcd' href='/hoidap/source/public/images/uploads/h".($i+2).".jpg'><img src='/hoidap/source/public/images/uploads/h".($i+2).".jpg' /></a>";
							}
						}elseif($sl==1){
							echo "<a class='post_ha_0 lb lb_abc' title='abcd' href='/hoidap/source/public/images/uploads/h1.jpg'><img src='/hoidap/source/public/images/uploads/h1.jpg' /></a>";
						}
						echo "</div>";
						*/
					}
					
					
					if($detai['post_type']==3)
					{
						if($detai['meta_images'] != "")
						{
							$meta_hinhanh =$detai['meta_images'];
						}
						else
						{
							//TODO: thay link hinh khi ko co hinh
							$meta_hinhanh ="";
						}
						$metablock = "block";
						if($detai['meta_title'] == NUll)
						{
							$metablock = "none";
						}
						?>
						<div class="post_link_comment" style="display:<?php echo $metablock ?>">
									
									<div class="img_link_post_cm">
										<img src="<?php echo $meta_hinhanh?>" />
									</div>
									<div class="noidung_link_post_cm" id="">
										<div class="tittle_link_post_cm">
												<a href="<?php echo $detai['meta_link']; ?>" target="_blank">
													<?php echo $detai['meta_title']; ?>								
												</a>
										</div>
										<div class="cling_link_post_cm">
											<a href="<?php echo $detai['meta_link']; ?>" target="_blank">
												<?php echo $detai['meta_base_url']; ?>			
											</a>
										</div>
										<div class="meta_link_post_cm">
											<?php echo $detai['meta_description']; ?>	
										</div>
									</div>
									<div class="clear"></div>
									
						</div>		
						<?php
					}
					?>
	
				</span>
					<div id="" class="onComment">
	
						<a href="javascript:none" onclick="document.getElementById('comment_<?php echo  $detai['ID']; ?>').style.display='inline-block';document.getElementById('<?php echo  $detai['ID']; ?>').focus();return false;">Bình luận</a>

					<span id="like_1_<?php echo  $detai['ID']; ?>" >
						<a href="javascript:none"  onclick="return ajlikes('1','<?php echo $detai['ID']?>',<?php echo $iduser ?>,'<?php echo $detai['like_status']?>','<?php echo $songuoilike ?>')" title=""><?php echo $detai['like']?></a>
					</span>
					
					<?php
					if($songuoilike >= 1)
						{			
							$ds_userlike = '';
							foreach($userlike[$k] AS $userlikes)
							{
							$ds_userlike .= $userlikes['user_name'];
							$ds_userlike .= " ,";
							}
							//echo $ds_userlike ;
							
						}
					?>
						<?php
						if($detai['like_status'] != NULL )
						{
							echo "<span id='youlike1$detai[ID]'>Bạn</span>";
						}
						else
						{
							echo "<span id='youlike1$detai[ID]'></span>";
						}
						?>
						
							
						<?php
						
						
						if($songuoilike != 0 && $detai['like_status'] != NULL)
						{
							echo "<span id='youlikeand1$detai[ID]'> và </span>";
						}
						else
						{
							echo "<span id='youlikeand1$detai[ID]'></span>";
						}
						
						if($songuoilike != 0 )
						{				
						
							// echo "<a onclick=\"return alert('$ds_userlike')\">".$songuoilike." Người khác </a>";
							echo "<a onclick=\"return like_popup({id:'$detai[ID]', type:'1'})\">".$songuoilike." Người khác </a>";
						}
						
						if($songuoilike != 0 || $detai['like_status'] != NULL)
						{
							echo "<span id='thichdieunay1$detai[ID]'>thích điều này.</span>";				
						}
						else
						{
							echo "<span id='thichdieunay1$detai[ID]'></span>";		
						}
					
						
						foreach ($thaoluan[$k] as $tl )
						{						
						
						
						$songuoilikecomment = count($tl['userlike']);
						
						if($songuoilikecomment >= 1)
						{				
							$ds_userlike = '';
							foreach($tl['userlike'] AS $userlikes)
							{
							$ds_userlike .= $userlikes['user_name'];
							$ds_userlike .= " ,";
							}
						//	echo $ds_userlike ;
						
						}					
						
				?>

							
						
						<div id="replyList_<?php echo $tl['ID']; ?>" class="replyList">
						<?php
						//TODO: kiem tra neu la bai viet cua minh thi moi cho xoa

						?>
						<span class="listpost_span">
									<div class="edit_post">
										<ul>
											<li class="firstItem"></li>
											<li class="lastItem" onclick="return comfirmdelete_popup({id:'<?php echo $tl['ID']; ?>',type:'comments'})"></li>
										</ul>
									</div>
									
								
										<img src="<?php echo $this->baseUrl('public/images/ava.jpg')?>" alt="">
										<h1>
											<a href="" title=""><?php echo $tl['user_name']; ?></a> - <?php echo $tl['c_datetime']; ?> ' 
												
											<span id="like_2_<?php echo  $tl['ID']; ?>" >
												<a href="javascript:none"  onclick="return ajlikes('2','<?php echo $tl['ID']?>',<?php echo $iduser ?>,'<?php echo $tl['like_status']?>','<?php echo $songuoilikecomment ?>')" title=""><?php echo $tl['like']; ?></a>
											</span>
										
						
							<?php
							if($tl['like_status'] != NULL )
							{
								echo "<span id='youlike2$tl[ID]'>Bạn</span>";
							}
							else
							{
								echo "<span id='youlike2$tl[ID]'></span>";
							}
							?>
							
								
							<?php
							
							
							if($songuoilikecomment != 0 && $tl['like_status'] != NULL)
							{
								echo "<span id='youlikeand2$tl[ID]'> và </span>";
							}
							else
							{
								echo "<span id='youlikeand2$tl[ID]'></span>";
							}
							
							if($songuoilikecomment != 0 )
							{	
							//	echo " <a class=\"popup\" href=\"http://localhost/hoidap/Source/likes/index/getuserlikesbypost?post=$tl[ID]\">".$songuoilikecomment." Người khác </a>";
							//	echo "<a onclick=\"return alert('$ds_userlike')\">".$songuoilikecomment." Người khác </a>";
								echo "<a onclick=\"return like_popup({id:'$tl[ID]', type:'2'})\">".$songuoilikecomment." Người khác </a>";
							
							}
							
							if($songuoilikecomment != 0 || $tl['like_status'] != NULL)
							{
								echo "<span id='thichdieunay2$tl[ID]'>thích điều này.</span>";				
							}
							else
							{
								echo "<span id='thichdieunay2$tl[ID]'></span>";		
							}
							?>
										</h1>
										<p>
											<?php echo $tl['comment_content']; ?>
										</p>
										<p class="clear"></p>
									</div><!-- / -->
							<?php
									}					
							?>
							<div id="new<?php echo $detai['ID']?>" ></div>
							<div id="comment_<?php echo $detai['ID']?>" >
							<?php
							// TODO: lay userid tu sestion
							$userid =5;
							?>
							<textarea class="binhluanArea" style="width: 437px; height: 17px; resize: none;" id="<?php echo $detai['ID']?>" onfocus="return add_comment_text({id:'<?php echo  $detai['ID'] ?>', author:'<?php echo  $userid ?>'})"  placeholder="Viết bình luận..."  autocomplete="off" ></textarea>
							</div>
							<!--
							<textarea></textarea>
							-->
								</div><!-- / -->
						</span>
					<div id="" class="clear"></div><!-- / -->
				</div><!-- / -->
				
						
				<?php
}
?>				
						
				
		

		
			</div><!-- / -->

		</div><!-- / CENTER CONTENT-->

		<div id="rightContent" class="floatRight">
			<div id="" class="quickPost">
				<ul id="" class="">
					<li class="quickMenu"><a href="" title="">Quick menu</a></li>
					<li class="addNews"><a href="" title="">Đăng tin</a></li>
				</ul><!-- / -->
				<ul id="" class="menuLeft">
					<li><a href="" title="">Thời trang</a>

						<div id="" class="subMenuFirst">
							<ul id="" class="">
								<li><a href="" title="">Title 1</a></li>
								<li><a href="" title="">Title 2</a></li>
								<li><a href="" title="">Title 3</a></li>
								<li><a href="" title="">Title 4</a></li>
							</ul><!-- / -->
						</div><!-- / Sub menu-->

					</li>
					<li><a href="" title="">Mỹ phẩm</a>

						<div id="" class="subMenuFirst">
							<ul id="" class="">
								<li><a href="" title="">Title 1</a></li>
								<li><a href="" title="">Title 2</a></li>
								<li><a href="" title="">Title 3</a></li>
								<li><a href="" title="">Title 4</a></li>
							</ul><!-- / -->
						</div><!-- / Sub menu-->

					</li>
					<li><a href="" title="">Điện máy</a></li>
					<li><a href="" title="">Máy tính-laptop</a></li>
					<li><a href="" title="">Việc làm</a></li>
					<li><a href="" title="">Kiến thức</a></li>
					<li><a href="" title="">Luật</a></li>
					<li><a href="" title="">Sức khỏe</a></li>
					<li><a href="" title="">Du lịch</a></li>
					<li><a href="" title="">Dịch vụ</a></li>
					<li><a href="" title="">Giải trí</a></li>
					<li><a href="" title="">Nội ngoại thất</a></li>
					<li><a href="" title="">Công nghiệp xây dựng</a></li>
				</ul><!-- / UL MENU-->
				<div class="clear"></div>
			</div><!-- / QUICK POST-->

			<div id="" class="box">
				<h1 class="adsT">Quảng cáo <a href="" class="floatRight" title="">Đặt quảng cáo</a></h1>
				
				<div id="" class="adsList">
					<h1><a href="" title="">Van Nguyen added a new photo</a></h1>
					<a href="" title=""><img src="http://kenh14.vcmedia.vn/zoom/120_75/zlA5ccccccccccccRby50VYME6hBz/Image/2012/04/120226starcllanh77703fAV_b7ff7.jpg" class="floatLeft" alt=""></a>
					<p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor. Aenean massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus.</p>
					<h2>Dang boi: <a href="" title="">Minh Man</a></h2>
				</div><!-- / ADS LIST-->
				<div id="" class="adsList">
					<h1><a href="" title="">Van Nguyen added a new photo</a></h1>
					<a href="" title=""><img src="http://kenh14.vcmedia.vn/zoom/120_75/zlA5ccccccccccccRby50VYME6hBz/Image/2012/04/120226starcllanh77703fAV_b7ff7.jpg" class="floatLeft" alt=""></a>
					<p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor. Aenean massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus.</p>
					<h2>Dang boi: <a href="" title="">Minh Man</a></h2>
				</div><!-- / ADS LIST-->
				
			</div><!-- / -->

			<div id="" class="box">
				<h1 class="adsT">Co the ban quen <a href="#" class="floatRight" title="">Xem tat ca</a></h1>
				<?php
					$ar_friend = $this->ar_friend;
					$str_id_friend = "";
					$count = count($ar_friend);
					for($i=0; $i<$count; $i++){
						$i>0 ? $str_id_friend = $str_id_friend .','. $ar_friend[$i]['id'] : $str_id_friend = $str_id_friend . $ar_friend[$i]['id'] ;
					}
					echo "<input type='hidden' id = 'str_id_friend' value = '$str_id_friend'/>";
					for($i=0; $i<$count; $i++){
				?>
				<div class="friend_vt_<?php echo $i+1; ?>">
					<div id="" class="friend fclose_<?php echo $ar_friend[$i]['id']?>">
						<div class="friend_close" title="Close friend" onclick="FRIENDSHIPS.close_insert_friend(<?php echo $ar_friend[$i]['id']?>, <?php echo $i+1;?>, document.getElementById('str_id_friend').value);"></div>
						<img src="<?php echo $this->baseUrl('public/images/ava.jpg')?>" alt="">
						<h1><?php echo $ar_friend[$i]['user_lastname'].' '.$ar_friend[$i]['user_firstname'];?></h1>
						<h2><?php echo $ar_friend[$i]['banchung']?> bạn chung</h2>
						<h3><img src="<?php echo $this->baseUrl('public/images/addF.jpg')?>" alt=""><a class="btn_themban" href="javascript:;" onclick="addfriend(<?php echo $ar_friend[$i]['id']?>, <?php echo $iduser;?>, <?php echo $i+1;?>, document.getElementById('str_id_friend').value)">Thêm bạn</a></h3>
					</div>
				</div>
				<?php }?>
				<!--
				<div id="" class="friend">
					<div class="friend_close"></div>
					<img src="<?php echo $this->baseUrl('public/images/ava.jpg')?>" alt="">
					<h1>Your friend name</h1>
					<h2>10 ban chung</h2>
					<h3><img src="<?php echo $this->baseUrl('public/images/addF.jpg')?>" alt=""><a href="javascript:;" onclick="addfriend('2',<?php echo $iduser;?>)">Them ban</a></h3>
				</div>-->
				
			</div><!-- / -->
		</div><!-- / RIGHT CONTENT-->
		</div>
		<div id="" class="clear"></div><!-- / -->
	</div><!-- / -->

	